<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\Goods
 *
 * @property int $goods_id
 * @property int $cat_id
 * @property string $goods_sn
 * @property string $goods_name
 * @property string $goods_name_style
 * @property int $click_count
 * @property int $brand_id
 * @property string $provider_name
 * @property int $goods_number
 * @property string $goods_weight
 * @property string $market_price
 * @property int $virtual_sales
 * @property string $shop_price
 * @property string $promote_price
 * @property int $promote_start_date
 * @property int $promote_end_date
 * @property int $warn_number
 * @property string $keywords
 * @property string $goods_brief
 * @property string $goods_desc
 * @property string $goods_thumb
 * @property string $goods_img
 * @property string $original_img
 * @property int $is_real
 * @property string $extension_code
 * @property int $is_on_sale
 * @property int $is_alone_sale
 * @property int $is_shipping
 * @property int $integral
 * @property int $add_time
 * @property int $sort_order
 * @property int $is_delete
 * @property int $is_best
 * @property int $is_new
 * @property int $is_hot
 * @property int $is_promote
 * @property int $bonus_type_id
 * @property int $last_update
 * @property int $goods_type
 * @property string $seller_note
 * @property int $give_integral
 * @property int $rank_integral
 * @property int|null $suppliers_id
 * @property int|null $is_check
 * @property string|null $delivery_status 是否允许快递配送
 * @property int $is_pintuan 是否开启商品拼团
 * @property string $pt_price 拼团金额
 * @property string|null $sales_volume_count 订单销量
 * @property string $active 是否开启秒杀，true开启，false关闭
 * @property string|null $start_time 秒杀开始时间
 * @property string|null $end_time 秒杀结束时间
 * @property int|null $spike_count 秒杀商品数量
 * @property string|null $spike_sum 秒杀商品金额
 * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\GoodsAttr> $attrs
 * @property-read int|null $attrs_count
 * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\GoodsGallery> $galleries
 * @property-read int|null $galleries_count
 * @method static \Illuminate\Database\Eloquent\Builder|Goods newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|Goods newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|Goods query()
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereActive($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereAddTime($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereBonusTypeId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereBrandId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereCatId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereClickCount($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereDeliveryStatus($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereEndTime($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereExtensionCode($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereGiveIntegral($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereGoodsBrief($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereGoodsDesc($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereGoodsId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereGoodsImg($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereGoodsName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereGoodsNameStyle($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereGoodsNumber($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereGoodsSn($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereGoodsThumb($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereGoodsType($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereGoodsWeight($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereIntegral($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereIsAloneSale($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereIsBest($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereIsCheck($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereIsDelete($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereIsHot($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereIsNew($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereIsOnSale($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereIsPintuan($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereIsPromote($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereIsReal($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereIsShipping($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereKeywords($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereLastUpdate($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereMarketPrice($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereOriginalImg($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods wherePromoteEndDate($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods wherePromotePrice($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods wherePromoteStartDate($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereProviderName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods wherePtPrice($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereRankIntegral($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereSalesVolumeCount($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereSellerNote($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereShopPrice($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereSortOrder($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereSpikeCount($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereSpikeSum($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereStartTime($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereSuppliersId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereVirtualSales($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Goods whereWarnNumber($value)
 * @mixin \Eloquent
 */
class Goods extends Model
{
    protected $table = 'goods';
    protected $primaryKey = 'goods_id';
    protected $fillable = [
        'goods_id', 'cat_id', 'goods_sn', 'goods_name', 'goods_name_style', 'click_count', 'brand_id',
        'provider_name', 'goods_number', 'goods_weight', 'market_price', 'virtual_sales', 'shop_price',
        'promote_price', 'promote_start_date', 'promote_end_date', 'warn_number', 'keywords', 'goods_brief',
        'goods_desc', 'goods_thumb', 'goods_img', 'original_img', 'is_real', 'extension_code', 'is_on_sale',
        'is_alone_sale', 'is_shipping', 'integral', 'add_time', 'sort_order', 'is_delete', 'is_best', 'is_new',
        'is_hot', 'is_promote', 'bonus_type_id', 'last_update', 'goods_type', 'seller_note', 'give_integral',
        'rank_integral', 'suppliers_id', 'is_check', 'delivery_status', 'is_pintuan', 'pt_price',
        'sales_volume_count', 'active', 'start_time', 'end_time', 'spike_count', 'spike_sum'
    ];

    public $timestamps = false;

    public function galleries()
    {
        return $this->hasMany(GoodsGallery::class, 'goods_id', 'goods_id');
    }

    public function attrs()
    {
        return $this->hasMany(GoodsAttr::class, 'goods_id', 'goods_id');
    }
}
